'use strict';


module.exports = class {
    constructor(app) {
        this.app = app;
        this.logger = app.logger;
        this.config = app.config;
    }
    async findOne(model, query) {
        return await this.app.mysql.get(model,query);
    }

    async find(model, query) {
        return await this.app.mysql.select(model,query);
    }
    async deleteOne(model, query) {
        return await this.app.mysql.delete(model,query);
    }
//     // 查询单条记录
//     const post = await app.mysql.get('posts', { id: 123 });
//
// // 条件查询
//     const results = await app.mysql.select('posts', {
//         where: { status: 'published' },
//         columns: ['id', 'title', 'author'],
//         orders: [['created_at', 'desc']],
//         limit: 10
//     });
//
// // 计数查询
//     const count = await app.mysql.count('posts', {
//         author: 'developer'
//     });
}
